<template>
  <div class='container-com-b'>
    B组件：<button @click="fn">传值给A组件</button>
  </div>
</template>

<script>
import eventBus from '@/eventBus'
export default {
  data () {
    return {
      str: '我是B组件的数据'
    }
  },
  methods: {
    fn () {
      eventBus.$emit('b2a', this.str)
    }
  }
}
</script>

<style scoped lang='less'></style>
